<!DOCTYPE html>

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title></title>
    <script src="./js/vue.js"></script>
</head>

<body>
    <div id="app">
        <button :style="isStyle=='按钮1'?abc:''" @click="click"> 按钮1</button>
        <button :style="isStyle=='按钮2'?abc:''" @click="click"> 按钮2</button>
        <button :style="isStyle=='按钮3'?abc:''" @click="click"> 按钮3</button>

    </div>
    <script>
        var vm = new Vue({
            el: '#app',
            data: {
                isStyle:'',
                abc:{
                    background:'black',
                    color:'white',
                }
            },
            methods: {
                click(event){
                    this.isStyle = event.target.innerText

                }
            }
        })
    </script>
</body>

</html>